/*
 * Event.h
 *
 *  Created on: 2008/12/25
 *      Author: Yongshik Cho
 */

#ifndef EVENT_H_
#define EVENT_H_

#ifndef PREREQUISITES_H_
#	include "../core/Prerequisites.h"
#endif


class EventDispatcher;

class Event
{
public:
	static const uint32 ON_ADD_CHILD 	= 0x0f01;
	static const uint32 ON_SUB_CHILD 	= 0x0f02;

	static const uint32 ON_PRE_RENDER 	= 0x0f04;
	static const uint32 ON_RENDER 		= 0x0f05;
	static const uint32 ON_POST_RENDER	= 0x0f06;

public:
	Event(const uint32 type, EventDispatcher* target = 0);
	virtual ~Event();

public:
	const uint32 getType() const { return mType; }
	const EventDispatcher* getTarget() const { return mTarget; }

	virtual bool operator == (const Event* e)
	{
		if(e->getType() == mType)
			return true;

		return false;
	}
	virtual bool operator == (const Event& e)
	{
		if(e.getType() == mType)
			return true;

		return false;
	}

public:
	uint32				mType;
	EventDispatcher*	mTarget;
};

#endif /* EVENT_H_ */
